package com.urfresh.sp.flume.dto.v3;

import com.alibaba.fastjson.annotation.JSONField;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.validator.constraints.NotEmpty;

/**
 * Created by urfresh.mark on 2016/8/24.
 * 基础信息表，所有埋点提交的数据都会包含这些数据（如果数据存在）
 */
public abstract class AppBaseInfo {
    //只有android设备存在
    @ApiModelProperty(value = "安卓设备id", required = false)
    @JSONField(ordinal = 0)
    String androidId;

    //只有ios设备存在
    @ApiModelProperty(value = "IOS的IDFA信息", required = false)
    @JSONField(ordinal = 1)
    String idfa;

    //用户注册后会存在
    @ApiModelProperty(value = "用户名", required = false)
    @JSONField(ordinal = 2)
    String userName;

    //app打开后就会存在，单如果用户卸载app重新安装，则appid会改变
    @ApiModelProperty(value = "appid", required = false)
//    @NotEmpty(message = "appid不能为空")
    @JSONField(ordinal = 3)
    String appId;

    //从微信登录会存在，截止到2016/8/24日，userName和openId尚未打通
    @ApiModelProperty(value = "微信登录时提供的openid", required = false)
    @JSONField(ordinal = 4)
    String openId;

    //信息提交时间
    @ApiModelProperty(value = "客户端提交请求的时间", required = false)
    @NotEmpty(message = "请求时间不能为空")
    @JSONField(ordinal = 5)
    String submitTime;

//    @ApiModelProperty(value = "验证码", required = false)
////    @NotEmpty(message = "验证码不能为空")
//    @JSONField(serialize = false)
//    String sign;

    public AppBaseInfo() {
    }

    public AppBaseInfo(String androidId, String openId, String idfa, String userName, String submitTime) {
        this.androidId = androidId;
        this.openId = openId;
        this.idfa = idfa;
        this.userName = userName;
        this.submitTime = submitTime;
    }


//    public String getSign() {
//        return sign;
//    }
//
//    public void setSign(String sign) {
//        this.sign = sign;
//    }

    public String getAndroidId() {
        return androidId;
    }

    public String getIdfa() {
        return idfa;
    }

    public void setAndroidId(String androidId) {
        this.androidId = androidId;
    }

    public void setIdfa(String idfa) {
        this.idfa = idfa;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public void setOpenId(String openId) {
        this.openId = openId;
    }

    public void setAppId(String appId) {
        this.appId = appId;
    }

    public String getUserName() {
        return userName;
    }

    public String getAppId() {
        return appId;
    }

    public String getOpenId() {
        return openId;
    }

    public String getSubmitTime() {
        return submitTime;
    }

    public void setSubmitTime(String submitTime) {
        this.submitTime = submitTime;
    }

    /**
     * 返回验证字符串
     * @return
     */
//    public abstract String getSignValue();


    }
